import { requestClient } from '#/api/request';

enum Api {
  CustomerList = '/hm/transferHistory/customer/list',
  OrderList = '/hm/transferHistory/order/list',
  TodoList = '/hm/transferHistory/todo/list',
  RevertBatch = '/hm/transferHistory/revert/batch',
  RevertCustomer = '/hm/transferHistory/revert/customer',
  RevertOrder = '/hm/transferHistory/revert/order',
  RevertTodo = '/hm/transferHistory/revert/todo',
}

export const getCustomerHistoryList = (params) =>
  requestClient.get(Api.CustomerList, { params });
export const getOrderHistoryList = (params) =>
  requestClient.get(Api.OrderList, { params });
export const getTodoHistoryList = (params) =>
  requestClient.get(Api.TodoList, { params });

export const revertBatch = (id: number) =>
  requestClient.postWithMsg(`${Api.RevertBatch}/${id}`);
export const revertCustomer = (id: number) =>
  requestClient.postWithMsg(`${Api.RevertCustomer}/${id}`);
export const revertOrder = (id: number) =>
  requestClient.postWithMsg(`${Api.RevertOrder}/${id}`);
export const revertTodo = (id: number) =>
  requestClient.postWithMsg(`${Api.RevertTodo}/${id}`);
